package com.gnkexy.springframework.context.supper;

import com.gnkexy.springframework.beans.factory.support.DefaultListableBeanFactory;
import com.gnkexy.springframework.beans.factory.xml.XmlBeanDefinitionReader;

import java.util.Arrays;

public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext {

    @Override
    protected void loadBeanDifinitions(DefaultListableBeanFactory beanFactory) {
        XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(beanFactory, this);
        String[] configLocaltion = getConfigLocations();
        if (configLocaltion != null) {
            reader.loadBeanDifinitions(configLocaltion[0]);
        }
    }

    protected abstract String[] getConfigLocations();
}
